import request from "@/api/http";

export const registerApi = (user_name: string, email: string, password: string, password_repeat: string) => {
    return request({
        url: '/account/register',
        method: 'post',
        data: {
            user_name: user_name,
            email: email,
            password: password,
            password_repeat: password_repeat
        }
    })
}

export const loginApi = (account: string, password: string) => {
    return request({
        url: '/account/login',
        method: 'post',
        data: {
            account: account,
            password: password
        }
    })
}

export const logoutApi = () => {
    return request({
        url: '/account/logout',
        method: 'post'
    })
}

export const userGetApi = () => {
    return request({
        url: '/account/current',
        method: 'get'
    })
}